package core.entities.objects.towers;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.geom.Circle;


import core.entities.Entity;
import core.entities.Projectile;

public class Tower extends Entity implements Cloneable
{
	protected int radius;
	protected Projectile projectile;
	protected int fireRate, price, damage;
	//TODO Effects ??? Animation ???
	
	
	public Tower(int x, int y, Image sprite)
	{
		super(x, y, sprite);
	}
	
	public Tower(Tower t)
	{
		super((int)t.x, (int)t.y, t.sprite);
		initialize(t.radius,  t.getProjectile(), t.fireRate, t.price);
	}
	
	public void initialize(int radius, Projectile template, int fireRate, int price)
	{
		this.radius = radius;
		this.projectile = template;
		this.fireRate = fireRate;
		this.price = price;
	}
	
	public void renderRadius(Graphics g, Color color)
	{
		g.setColor(new Color(0,0,0,32));
		Circle shape = new Circle(x + w/2, y + h/2, radius);
		g.draw(shape);
		g.setColor(color);
		g.fill(shape);
	}
	
	public Projectile getProjectile()
	{
		return projectile;
	}
	
	public int getRadius()
	{
		return radius;
	}
	
}
